
import bbRequest from "..";

import { IAccount} from "./type";

enum LoginAPI {
    AccountLogin = '/login',
    LoginUserInfo = '/users/',
    UserMenuInfo = '/role/'
}

//登录接口
export function accountLoginRequest(account:IAccount){
    return bbRequest.post({
        url:LoginAPI.AccountLogin,
        data:account,
        
        
    })
}

//请求用户数据
export function userInfoRequest(id:number){
    return bbRequest.get({
        url:LoginAPI.LoginUserInfo + id,
        showLoading:false
    })
}

//根据用户的权限来进行菜单的渲染
 export function userMenuInfoRequest(id:number){
    return bbRequest.get({
        url:LoginAPI.UserMenuInfo + id + '/menu',
        showLoading:false
    })
 }